<%@page import="org.lxy.domain.RecycleGoodsEntity"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.lxy.domain.GoodsTypeEntity" %>
<%@ page import="org.lxy.utils.CoreUtils" %>
<%@ page import="org.lxy.domain.RecyclePointEntity" %>
<%@ page import="org.lxy.domain.UserInfoEntity" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
     <base href="<%=basePath %>"/>
    <title>Edit</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
 <link rel="Stylesheet" href="css/Form.css" />
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
    <style type="text/css">
      {
            margin: 0px;
            padding: 0px;
            font-weight: bold;
       }
        .td_right
       {
            text-align: right;
      }
    </style>
    <script>
    function checkform(){
    	if($("#oldpassword").val()==""){
    		alert("旧密码不能为空");
    		return false;
    	}
    	if($("#password").val()==""){
    		alert("新密码不能为空");
    		return false;
    	}
    	if($("#repwd").val()==""){
    		alert("确认密码不能为空");
    		return false;
    	}
    	if($("#repwd").val()!=$("#password").val()){
    		alert("两次密码输入不一致");
    		return false;	
    	}
    	var tag=true;
    	$.post("/checkpassword",{oldpassword:$("#oldpassword").val()},function(data){
    		   if(data==0){
    			   alert("旧密码输入不正确");
    			   tag= false;
    		   }		
    	});
    	
    	return tag;
    }
    </script>
  </head>
  
  <body>
    <form id="form1" action="/changepwdresult" method="post">
    <div>
    <%
        UserInfoEntity entity = (UserInfoEntity) request.getAttribute("entity");
    %>
        <table style="text-align: center; vertical-align: middle; line-height: 50px; margin-left: 20px;
            margin-top: 20px;">
               
		   <tr>
                <td class="td_right">
                 旧密码：
                </td>
                <td>
                <input type="password" id="oldpassword" name="oldpassword" class="search_txt"/>
                </td>
            </tr><tr>
                <td class="td_right">
                 新密码：
                </td>
                <td>
                <input type="password" id="password" name="password" class="search_txt"/>
                </td>
            </tr><tr>
                <td class="td_right">
                 确认新密码：
                </td>
                <td>
                <input type="password" id="repwd" name="repwd" class="search_txt"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                <input  type="submit" id="btnOK" value="保存" class="btn_css submitbg" onclick="return checkform();"/>
                    <input type="button" id="btnCZ" value="关闭" onclick="window.parent.closedialog();"
                        class="btn_css reserbg" style="margin-left: 20px;" />
                </td>
            </tr>
        </table>
    </div>
    </form>
  </body>
</html>
